//
//  PCDApiGetSystemInfo.m
//  PCDMPaasBank
//
//  Created by DK on 2021/4/1.
//  Copyright © 2021 Alibaba. All rights reserved.
//

#import "PCDApiGetSystemInfo.h"

#define SDKVersion @"6.1"

@implementation PCDApiGetSystemInfo

- (void)handler:(id)data andContext:(PCDContext *)context ResponseCallback:(WVJBResponseCallback)responseCallback
{
    NSDictionary *parameters = (NSDictionary *)data;
    NSString *callBack = [parameters objectForKey:@"success"];
    CGFloat topHeight = [PCDUtil IsIphoneX]?44:0;
    
    CGFloat bottomHeight = [PCDUtil IsIphoneX]?34.0f:0;
    
    NSDictionary *params = @{@"SDKVersion":SDKVersion,@"version":[PCDUtil appVersion],@"url":[PCDUtil getServerURL:@""],@"topHeight":[NSString stringWithFormat:@"%f",topHeight],@"bottomHeight":[NSString stringWithFormat:@"%f",bottomHeight]};
    evaluateJavaScriptOnMainThread(self, callBack, [params JSONRepresentation]);
}

@end
